const iconv   = require('iconv-lite');
var str = '"clipImgSize": 0,"cmd": "ivs_result","fullImgSize": 0,';
var str2 = '{"PlateResult":{"bright":0,"carBright":0,"carColor":0,"car_brand":{"brand":255,"type":255,"year":65535},"car_location":{"RECT":{"bottom":1295,"left":719,"right":1740,"top":781}},"colorType":1,"colorValue":0,"confidence":100,"direction":0,"enable_encrypt":0,"fake_plate":0,"featureCode":true,"license":"��AF0236","location":{"RECT":{"bottom":1186,"left":1011,"right":1448,"top":948}},"plate_distance":0,"plate_true_width":0,"timeStamp":{"Timeval":{"sec":1621994089,"usec":55919}},"timeUsed":115,"triggerType":8,"type":1},"active_id":0,"clipImgSize":0,"cmd":"ivs_result","fullImgSize":0,"id":142,"imageformat":"jpg","timeString":"2021-05-26 09:54:49"};'+'\x00';
/*
console.log(str2.indexOf("\x00"));
console.log(str2.length);
var reg = RegExp(/"cmd": "ivs_result"/);
console.log(reg.test(str));
*/

var test = new Buffer([0xbe, 0xa9 ,0x41 ,0x46 ,0x30 ,0x32, 0x33, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xb6, 0xc9, 0xab, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x04 ,0x00 ,0x00 ,0x00, 0x8f, 0x02, 0x00, 0x00, 0x77, 0x04]);



console.log(iconv.decode(test,'gbk'));